<?php
global $cquery ;// = new CommonQuery($con,$conn,$database_conn);
global $HOME_URL;
global $SITE_ID;
if(isset($_POST['site_id'])){
	$queryOutCome = $cquery->registerClient();

}
if(isset($_POST['site_id']) &&  strrpos($queryOutCome,"Unable")<0)
{
  echo "<div class='success'> ".$queryOutCome."</div>";
}else{
 echo "<div class='fail'> ".$queryOutCome."</div>";
?>

<div id="registerform">
    <form name="form1" method="post" action="" class="validatefrm">
        <div id="ermsg"></div>
        <table width="100%" border="0" cellpadding="3" cellspacing="3">
            <tr>
                <td colspan="2" valign="top"><h2  class="underline">Details</h2></td>
            </tr>
            <tr>
                <td width="31%" valign="top">Name of Person / Organisation </td>
                <td width="69%">            <input name="name" type="text" id="name" class="reqd">          </td>
            </tr>
            <tr>
                <td valign="top">Country</td>
                <td><label>

                        <select name="country" id="country" onchange="getData('<?php echo $HOME_URL; ?>pages/ajax.php?country='+this.value,'city')" class="reqd">
                            <option value="0">Choose a country</option>
                            <?php echo $cquery->showCountryCombo("option");?>
                        </select>
                    </label></td>
            </tr>
            <tr>
                <td valign="top">City</td>
                <td >
                    <select id="city" name="city" class="reqd">
                        <option value="0">Choose a country</option>
                    </select>
              </td>
            </tr>
            <tr>
                <td valign="top">Email Address </td>
                <td><input name="emailadd" type="text" id="emailadd" class="reqd email" ></td>
            </tr>
            <tr>
                <td valign="top">Telephone Number </td>
                <td><input name="telnum" type="text" id="telnum" class="reqd"></td>
            </tr>
            <tr>
                <td valign="top">Postal Address </td>
                <td><textarea name="postal_add" id="postal_add"></textarea></td>
            </tr>
            <tr>
                <td valign="top">Physical Address </td>
                <td>
                    <textarea name="phy_add" id="phy_add" rows="5">

                    </textarea></td>
            </tr>
            <tr>
                <td colspan="2" valign="top"><h2 class="underline">Contact Person </h2></td>
            </tr>
            <tr>
                <td valign="top">Contact Person</td>
                <td><input name="contact_person" type="text" id="contact_person" class="reqd"></td>
            </tr>
            <tr>
                <td valign="top">Phone Number</td>
                <td><input name="phonenumber" type="text" id="phonenumber" class="reqd"></td>
            </tr>
            <tr>
                <td colspan="2" valign="top"><h2  class="underline">Login Details</h2></td>
            </tr>
            <tr>
                <td valign="top">Username</td>
                <td><input name="username" type="text" id="username" class="reqd"></td>
            </tr>
            <tr>
                <td valign="top">Password</td>
                <td><input name="password" type="password" id="password" class="reqd"></td>
            </tr>
            <tr>
                <td valign="top">&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td><input name="site_id" type="hidden" id="site_id" value="<?php echo $SITE_ID; ?>" /></td>
                <td>
                    <label>
                        <input type="submit" name="Submit" value="Register">
                        <input type="reset" name="clear" value="Clear">
                    </label></td>
            </tr>
        </table>
    </form>

</div>	
<?php } ?>